From ca4bd2c1aea9818c9220d2a8c967fa1187448ad5 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Sat, 29 Dec 2007 17:55:47 +0000 Subject: [PATCH] vmx: Fix the 2nd argument of cpuid_count() in vmx_cpuid_intercept() For input 0x00000004, the value of "*ecx" has been overwritten by the cpuid() in hvm_cpuid(), causing a bad value passed to cpuid_count(). Signed-off-by: Dexuan Cui --- xen/arch/x86/hvm/vmx/vmx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 1e700d8d2e..b414078ab2 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -1235,6 +1235,7 @@ void vmx_cpuid_intercept( unsigned int *ecx, unsigned int *edx) { unsigned int input = *eax; + unsigned int count = *ecx; #ifdef VMXASSIST if ( input == 0x40000003 ) @@ -1293,7 +1294,7 @@ void vmx_cpuid_intercept( break; case 0x00000004: - cpuid_count(input, *ecx, eax, ebx, ecx, edx); + cpuid_count(input, count, eax, ebx, ecx, edx); *eax &= NUM_CORES_RESET_MASK; break; -- 2.30.2